package main

import "math/rand"

func rand7() int {
	return rand.Intn(7) + 1
}

func rand10() int {
	for {
		r := (rand7() - 1) * 7 + rand7()
		if r <= 40 {
			return r%10+1
		}
	}
}

func main() {
	println(rand10())
}